package design.mode.model.factory.abstractfactory.factorytest;

import design.mode.model.factory.abstractfactory.factory.ItalyDessertFactory;
import design.mode.model.factory.coffee.Coffee;
import design.mode.model.factory.coffee.LettaCoffee;
import design.mode.model.factory.tiramisu.Dessert;
import design.mode.model.factory.tiramisu.MatchaMousse;

/**
 * @author ldanniel
 * @description 抽象工厂测试类
 * @date 2023/21/18:42
 * @since jdk11
 */
public class AbstractFactoryTest {
    public static void main(String[] args) {
        ItalyDessertFactory italyDessertFactory = new ItalyDessertFactory();
        Coffee coffee = italyDessertFactory.createCoffee(LettaCoffee.class);
        String name = coffee.getName();
        System.out.println(name);

        Dessert dessert = italyDessertFactory.createDessert(MatchaMousse.class);
        dessert.show();
    }
}
